//
//  SWInitializer.h
//  s.
//
//  Created by 谈虎啸 on 2022/8/31.
//  Copyright © 2022 J. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "JYGradientButton.h"
@class MASConstraintMaker;
NS_ASSUME_NONNULL_BEGIN

@interface SWInitializer : NSObject
//MARK: - UIView
/// 创建一个UIView
+ (UIView *)jy_initViewWithBgColor:(nullable UIColor *)bgColor
                             on:(nullable UIView *)superView
                         layout:(nullable void(^)(MASConstraintMaker *make))layout;

//MARK: - UILabel
/// 创建一个UILabel
+ (UILabel *)jy_initLabelWithText:(nullable NSString *)text
                     textColor:(nullable UIColor *)textColor
                          font:(nullable UIFont *)font
                       bgColor:(nullable UIColor *)bgColor
                            on:(nullable UIView *)superView
                        layout:(nullable void(^)(MASConstraintMaker *make))layout;

//MARK: - UIImageView
/// 创建一个UIImageView
+ (UIImageView *)jy_initImageViewWithImage:(nullable UIImage *)image
                                     on:(nullable UIView *)superView
                                 layout:(nullable void(^)(MASConstraintMaker *make))layout;

//MARK: - UIButton
/// 创建一个文本按钮
+ (UIButton *)jy_initButtonWithTarget:(nullable id)target
                            action:(nullable SEL)action
                             title:(nullable NSString *)title
                        titleColor:(nullable UIColor *)titleColor
                              font:(nullable UIFont *)font
                           bgColor:(nullable UIColor *)bgColor
                                on:(nullable UIView *)superView
                            layout:(nullable void(^)(MASConstraintMaker *make))layout;

/// 创建一个红色渐变按钮
+ (JYGradientButton *)jy_initRedButtonWithTarget:(nullable id)target
                            action:(nullable SEL)action
                             frame:(CGRect)frame
                             title:(nullable NSString *)title
                                on:(nullable UIView *)superView
                            layout:(nullable void(^)(MASConstraintMaker *make))layout;

/// 创建一个白色渐变按钮
+ (JYGradientButton *)jy_initWhiteButtonWithTarget:(nullable id)target
                            action:(nullable SEL)action
                             frame:(CGRect)frame
                             title:(nullable NSString *)title
                                on:(nullable UIView *)superView
                            layout:(nullable void(^)(MASConstraintMaker *make))layout;



/// 创建一个图片按钮
+ (UIButton *)jy_initButtonWithTarget:(nullable id)target
                            action:(nullable SEL)action
                             image:(nullable UIImage *)image
                                on:(nullable UIView *)superView
                            layout:(nullable void(^)(MASConstraintMaker *make))layout;

//MARK: - UITextField
/// 创建一个UITextField
+ (UITextField *)jy_initTextFieldWithText:(nullable NSString *)text
                             textColor:(nullable UIColor *)textColor
                                  font:(nullable UIFont *)font
                             placeHold:(nullable NSString *)placeHold
                        placeHoldColor:(nullable UIColor *)placeHoldColor
                         placeHoldFont:(nullable UIFont *)placeHoldFont
                               bgColor:(nullable UIColor *)bgColor
                              delegate:(nullable id<UITextFieldDelegate>)delegate
                                    on:(nullable UIView *)superView
                                layout:(nullable void(^)(MASConstraintMaker *make))layout;

//MARK: - ScrollView
+ (UIScrollView *)jy_initScrollViewWithBgColor:(nullable UIColor *)bgColor
                                   delegate:(nullable id<UIScrollViewDelegate>)delegate
                                         on:(nullable UIView *)superView
                                     layout:(nullable void(^)(MASConstraintMaker *make))layout;

//MARK: - UITableView
+ (UITableView *)jy_initTableViewWithBackgroundColor:(nullable UIColor *)bgColor
                                    style:(UITableViewStyle)style
                                 delegate:(nullable id<UITableViewDelegate, UITableViewDataSource>)delegate
                                       on:(nullable UIView *)superView
                                   layout:(nullable void(^)(MASConstraintMaker *make))layout;

@end

NS_ASSUME_NONNULL_END
